<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
  <style>
	  .layui-form-label{ width:10%;}
	  .layui-form-item .layui-input-inline{width: 80%;}
  </style>  
</head>
<body>

  <div class="layui-form layui-form-view" style="padding: 20px 30px 0 0;">
	  
		<div class="layui-form-item">
			<label class="layui-form-label">id</label>
			<div class="layui-input-inline">{$r.id}</div>
		</div>
		<div class="layui-form-item">	
			<label class="layui-form-label">栏目</label>
			<div class="layui-input-inline">{$cat.name}</div>
		</div>		
	  
	{foreach $data as $v}
		<div class="layui-form-item">
			<label class="layui-form-label">{$v.name}</label>
			<div class="layui-input-inline">
				{switch $v.formtype}
					{case date}
						{$v.value|date="Y-m-d H:i:s"}
					{/case}
					{case image}
						<a class="imageField_fancybox" rel="{$v.field}_rel" href="{$v.value}" target="_blank"><img class="images" src="{$v.value}" style="width:200px; border:1px green dotted"></a>
					{/case}
					{case textarea}
						{$v.value|nl2br|raw}
					{/case}
					{case morepic}
						<div class="morepic">
							<div class="morepic_box">
								<div class="piclist" data-field="{$v.field}">
									<ul id="{$v.field}_piclist_ul">
										<?php
										$morepic_arr=explode("\r\n",$v['value']);
										foreach($morepic_arr as $v2){
											if(!$v2){break;};
											$vs=explode("||",$v2);
										?>
										<li title="拖动我是可以排序的哦" draggable="false">
											<a class="piclist_img {$v.field}_fancybox" rel="{$v.field}_rel" title="<?=$vs[2]?>" href="<?=$vs[1]?>">
												<img src="<?=$vs[0]?>" draggable="false">
											</a>
											<div class="piclist_title"><?=$vs[2]?></div>
										</li>
										<?php
										}                     
										?>                                        
										<div class="clear"></div>
									</ul>
								</div>                                        
							</div>
						</div>
					{/case}
					{case morevalue}
						<table class="layui-table">
						    <thead>
							    <tr>
								<?php
								$morevalueField=str2arr($v['defaultval'],"{{RsSplit}}","{{FieldSplit}}");
								foreach($morevalueField as $v2){
								?>
								<th class="center" width="{$v2[3]}%">{$v2[0]}</th>
								<?php
								}
								?>
							    </tr> 
						    </thead>
						    <tbody>
								<?php
								$morevalue=str2arr($v['value'],"{{RsSplit}}","{{FieldSplit}}");
								foreach($morevalue as $v2){
								?>								
								<tr>
									<?php
									foreach($morevalueField as $k3=>$v3){
									?>
									<td style="text-align:center;">
										{if $v3[1]=="image"}
											<a class="imageField_fancybox" rel="{$v.field}_rel" href="{$v2[$k3]}" target="_blank"><img class="images" src="{$v2[$k3]}" style="height:100px; border:1px green dotted"></a>
										{elseif $v3[1]=="video"}
											{if $v2[$k3]}
												<video style="height:200px" src="{$v2[$k3]}" controls="controls"></video>
											{else/}
												-
											{/if}										
										{elseif $v3[1]=="file"}
											<a href="{$v2[$k3]}" target="_blank">{$v2[$k3]}</a>
										{else /}
											{$v2[$k3]}
										{/if}																				
									</td>
									<?php
									}
									?>
								</tr>
								<?php
								}
								?>
								</tbody>
							</table>
					{/case}			
					{case file}
						<a href="{$v.value}" target="_blank" style="color: green; text-decoration: underline;">{$v.value}</a>
					{/case}															
					{case video}
						{if $v.value}
						<video style="width:400px" src="{$v.value}" controls="controls"></video>
						{else/}
						-
						{/if}
					{/case}	
					{case file}
						<img class="images" src="{$v.value}" style="width:200px; border:1px green dotted">
					{/case}	
					{case file}
						<a href="{$v.value}" target="_blank">{$v.value}</a>
					{/case}		
					{case editor}
						{$v.value|raw}
					{/case}															
					{default /}
						{$v.value|raw}
				{/switch}		  
			</div>
		</div>
	{/foreach}
	
	<div class="layui-form-item layui-layout-admin" style="margin-top: 30px;">
		<div class="layui-input-block">
		   <div class="layui-footer" style="left: 0;">
			  <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
		  </div>
		</div>
	</div>  

  </div>

  {include file="info/js"}
  <script>
	  $(".imageField_fancybox").fancybox();
  </script>
</body>
</html>